import {Component, OnInit} from '@angular/core';
import {ApiService} from "../shared/api.service";
import {Observable} from "rxjs";

@Component({
  selector: 'oidc-app-admin2',
  template: `
    <p class="alert alert-danger">
      This is the <strong>🔧 ADMIN 2</strong> component.
      if has not success, It will redirect you to login if needed.
      - {{ apiResponse | async }}
    </p>
  `,
  styles: [
  ]
})
export class Admin2Component implements OnInit {
  apiResponse!: Observable<string>;

  constructor(private apiService: ApiService) { }

  ngOnInit(): void {
    this.apiResponse = this.apiService.getProtectedApiResponse();
  }

}
